
import { Component, Sprite, _decorator } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('HeatMapPoint2D')
export class HeatMapPoint2D extends Component {
    @property
     private _alphaFix = 1;
     
     public get alphaFix(){
        return this._alphaFix;
     }

     public set alphaFix(val){
        this._alphaFix = val;
        this.setAlphaFix(val);
     }
    

    public start() {
        
    }

    public update(deltaTime: number) {}

    public setIntensity(intensity: number) {
      this.alphaFix = intensity;
    }

    public setAlphaFix(alpha:number){
        const spriteComp = this.getComponent(Sprite);
        spriteComp.material.setProperty('alphaFix', alpha);

    }
}
